package net.crashtoot.picasa.local.domain;

import java.io.File;
import java.io.FilenameFilter;
import java.util.Arrays;
import java.util.List;

public class LocalAlbum {

    static FilenameFilter imageIOFilter = new FilenameFilter() {
        public boolean accept(final File file, final String filename) {
            String lowerFilename = filename.toLowerCase();
            return lowerFilename.endsWith(".jpg") || lowerFilename.endsWith(".jpeg") || lowerFilename.endsWith(".png")
                    || lowerFilename.endsWith(".gif") || lowerFilename.endsWith(".bmp");
        }
    };

    private final File file;

    public LocalAlbum(final File file) {
        this.file = file;
    }

    public List<File> getImages() {
        return Arrays.asList(file.listFiles(imageIOFilter));
    }

    public String getName() {
        return file.getName();
    }

}
